package org.guangzhou.notepad.activity;

import org.guangzhou.notepad.R;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class LoginActivity extends Activity {
	
	private String logTag = "LoginActivity-----";
	private Context content = this;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        
        TextView registT = (TextView)findViewById(R.id.regist_text);
        registT.setOnClickListener(new RegistListioner());
        
        TextView forgetT = (TextView)findViewById(R.id.forget_text);
        forgetT.setOnClickListener(new ForgetListioner());
        
        Button loginB = (Button)findViewById(R.id.login_submit);
        loginB.setOnClickListener(new LoginListioner());
        
        
    }
    
    
    class LoginListioner implements OnClickListener{
		@Override
		public void onClick(View v) {
			Intent intentAddCity = new Intent(content, ListNoteActivity.class);
			content.startActivity(intentAddCity);
			finish();//登陆成功就可以把这个Activity关闭了
		}
	}
    
    class RegistListioner implements OnClickListener{
		@Override
		public void onClick(View v) {
			Intent intentAddCity = new Intent(content, RegistActivity.class);
			content.startActivity(intentAddCity);
		}
	}
    
    class ForgetListioner implements OnClickListener{
		@Override
		public void onClick(View v) {
			Intent intentAddCity = new Intent(content, BackPwdActivity.class);
			content.startActivity(intentAddCity);
		}
	}
    
    
    
}